Time Series Plot

TODO: Explain the default plot.

# Loading the demo data set
data <- demodata()
# Faking ffx (wind gusts) as we don't have them in the data set.
data$ffx       <- runif(nrow(data), 1.4, 1.7) * data$ff
data$crest_ffx <- runif(nrow(data), 1.5, 2.5) * data$crest_ff
# Show data set 
head(data, n = 3)
##                      dd  ff     p rh    t crest_dd crest_ff crest_p
## 2010-01-18 09:00:00 338 1.2 899.8 75 -0.9        3      5.6   787.7
## 2010-01-18 10:00:00  18 0.1 899.9 66  0.2      344      5.3   787.9
## 2010-01-18 11:00:00 344 0.8 899.1 63  0.7      360      6.0   787.3
##                     crest_rh crest_t diff_t       ffx crest_ffx
## 2010-01-18 09:00:00       93    -8.7   2.47 1.8361914  11.30778
## 2010-01-18 10:00:00       90    -8.0   2.07 0.1581422  10.84028
## 2010-01-18 11:00:00       80    -7.7   1.87 1.2052541  11.32779
# Estimate a foehnix classification model
filter <- list(dd = c(43, 223), crest_dd = c(90, 270))
mod <- foehnix(diff_t ~ ff + rh, data = data, filter = filter,
               switch = TRUE, verbose = FALSE)

# Plotting windroses
tsplot(mod, start = "2015-05-01", end = "2015-05-10")

Different Styles

TODO: The style argument (input to tsplot.control) allows to change between different styles provided by the foehnix package. The styles can be modified by the user (see next section).

tsplot(mod, start = "2015-05-01", end = "2015-05-10",
       style = "advanced")

tsplot(mod, start = "2015-05-01", end = "2015-05-10",
       style = "bw")

Modify styles

TODO: No matter which style one takes, one is always allowd to overwrite specific properties of such as line type, color, …. This allows for high customization of the plots.

As an example we change the appearance of the observed air temperature (t) and disable two parameters (crest_t and diff_t) by setting them to NULL.

devtools::load_all("../")
## Loading foehnix
tsplot(mod, start = "2015-05-01", end = "2015-05-10",
       t       = list(col = "blue", lty = 3, lwd = 4),
       crest_t = NULL, # Disable crest temperature
       diff_t  = NULL, # Disable temperature difference
       style = "advanced")

The same can, of course, be done with the black and white style:

tsplot(mod, start = "2015-05-01", end = "2015-05-10",
       t = list(col = "orange", type = "o", pch = 18),
       style = "bw")

Highlight Wind Sectors

TODO: Wind sectors (as for the windrose plot) can be used to set specific highlights. This optional argument is also forwarded to tsplot.control.

tsplot(mod, start = "2015-05-01", end = "2015-05-10",
       windsector = list("Sector A" = c(30, 120), "Sector B" = c(200, 260)),
       foehnix_windsector = list(col = "orange"), # Custom color
       style = "bw")